{{!< default}} {{#post}} <div class="content-wrap  page-post-detail">
    <div id="content" class="content">
        <div id="post" class="posts-expand fadeInDown">
            <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
                <header class="post-header">
                    <h1 class="post-title" itemprop="name headline">{{title}}</h1>
                    <div class="post-meta">
                        <span class="post-time">
                            <span class="post-id">{{id}}</span>
                            <span class="post-meta-item-icon">
                                <i class="fa fa-user"></i>
                            </span>
                            <span>{{author}}</span>&nbsp; | &nbsp;
                            <span class="post-meta-item-icon">
                                <i class="fa fa-calendar-o"></i>
                            </span>
                            <span class="post-meta-item-text">发表于</span>
                            <time itemprop="dateCreated">{{date format='YYYY-MM-DD'}}</time>
                        </span>
                        <span class="post-category">&nbsp; | &nbsp;
                            <span class="post-meta-item-icon">
                                <i class="fa fa-folder-o"></i>
                            </span>
                            <span class="post-meta-item-text">标签</span>
                            <span itemprop="about" itemscope="" itemtype="https://schema.org/Thing">
                                {{#if tags}} {{tags}} {{/if}}
                            </span>
                        </span>
                        <span class="post-pv">&nbsp; | &nbsp;
                            <span class="post-meta-item-icon">
                                <i class="fa fa-eye"></i>
                            </span>
                            <span class="post-meta-item-text">阅读数</span>
                            <span id="pv"></span>
                        </span>
                        <span class="post-comments-count">&nbsp; | &nbsp;
                            <a href="#comments" itemprop="discussionUrl">
                                <span class="post-comments-count ds-thread-count" data-thread-key="{{id}}" itemprop="commentsCount"></span>
                            </a>
                        </span>
                    </div>
                </header>
                <div class="post-body" itemprop="articleBody">
                    {{content}}
                </div>
            </article>
        </div>
    </div>
    <div class="comments" id="comment">
        <!--畅言PC和WAP自适应版-->
        <div id="SOHUCS" sid="{{id}}"></div>
        <script type="text/javascript"> 
            (function () {
                var appid = 'cytwheKax';
                var conf = 'prod_5c3eae7ba3cd08552b754951a5c979cc';
                var width = window.innerWidth || document.documentElement.clientWidth;
                if (width < 960) {
                    window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
                } else {
                    var loadJs = function (d, a) {
                        var c = document.getElementsByTagName("head")[0] || document.head || document.documentElement;
                        var b = document.createElement("script"); b.setAttribute("type", "text/javascript");
                        b.setAttribute("charset", "UTF-8"); b.setAttribute("src", d);
                        if (typeof a === "function") {
                            if (window.attachEvent) {
                                b.onreadystatechange = function () {
                                    var e = b.readyState;
                                    if (e === "loaded" || e === "complete") {
                                        b.onreadystatechange = null; a()
                                    }
                                }
                            } else { b.onload = a }
                        } c.appendChild(b)
                    };
                    loadJs("https://changyan.sohu.com/upload/changyan.js", function () {
                        window.changyan.api.config({ appid: appid, conf: conf })
                    });
                }
            })(); </script>
    </div>
    </div>
    {{/post}}
    <div class="sidebar-toggle">
        <div class="sidebar-toggle-line-wrap">
            <span class="sidebar-toggle-line sidebar-toggle-line-first" style="background: #87daff;"></span>
            <span class="sidebar-toggle-line sidebar-toggle-line-middle" style="background: #87daff;"></span>
            <span class="sidebar-toggle-line sidebar-toggle-line-last" style="background: #87daff;"></span>
        </div>
    </div>

    <aside id="sidebar" class="sidebar page-post-detail">
        <div class="sidebar-inner">
            <ul class="sidebar-nav motion-element">
                <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
                    文章目录
                </li>
                <li class="sidebar-nav-overview" data-target="site-overview">
                    站点概览
                </li>
            </ul>
            {{> sidebar}}
            <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
                <div class="post-toc-indicator-top post-toc-indicator">
                    <i class="fa fa-angle-double-up"></i>
                </div>
                <div class="post-toc">
                    <div class="post-toc-content">
                        <ol class="nav" id="category_nav">
                        </ol>
                    </div>
                </div>
                <div class="post-toc-indicator-bottom post-toc-indicator">
                    <i class="fa fa-angle-double-down"></i>
                </div>
            </section>
        </div>
    </aside>
    <script type="text/javascript">
        $(".site-overview").css("display", "none");
        if ($("#content h2").length > 0) {
            $("#content h2").each(function () {
                $(this).attr("id", $(this).html().replace(/ +/g, '-').replace(/<(\/a|a).*>/g, ""));
                $("#category_nav").html($("#category_nav").html() + '<li class="nav-item nav-level-2"><a class="nav-link" href="#' + $(this).html().replace(/ +/g, '-').replace(/<(\/a|a).*>/g, "") + '"><span class="nav-text">' + $(this).html().replace(/<(\/a|a).*>/g, "") + '</span></a></li>');
            });
        } else {
            $("#category_nav").html($("#category_nav").html() + '<span class="nav-text">暂无目录</span>');
        }
        var postId = $(".post-id").text()
        // 更新文章pv
        $.ajax({
            url: CONFIG.APIURL + "/pv",
            method: "post",
            dataType: "json",
            data: {
                postId: postId
            },
            success: function (res) {
                if (res.code == 200) {
                    $("#pv").text(res.data.pv)
                }
            }
        })
    </script>